home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 2
/
Nebula Two.iso
/
SourceCode
/
Palettes
/
Chart
/
Source
/
BarChartPS.psw
< prev
next >
Wrap
Text File
|
1995-06-12
|
2KB
|
99 lines
// -------------------------------------------------------------------------------------
// custom PS for BarChart palette
// -------------------------------------------------------------------------------------
// draw crossHair at specified point
defineps _barDrawCrossHair(float x, y, len)
newpath
x len 2 div sub y moveto len 0 rlineto
x y len 2 div sub moveto 0 len rlineto
stroke
endps
// draw text 90 deg counterclockwise
defineps _barDrawVertText(float x, y; char *string)
newpath
x y translate
0 0 moveto
90 rotate
(string) show
stroke
endps
// draw text
defineps _barDrawText(float x, y; char *string)
newpath
x y moveto
(string) show
stroke
endps
// draw small rectangular point
defineps _barDrawPoint(float x, y; float width)
newpath
x y moveto
width 2 div
neg dup rmoveto
0 width rlineto
width 0 rlineto
0 width neg rlineto
closepath
fill
endps
// draw absolute line
defineps _barALine(float x, y; float x2, y2)
newpath
x y moveto
x2 y2 lineto
stroke
endps
// draw relative line
defineps _barRLine(float x, y; float dx, dy)
newpath
x y moveto
dx dy rlineto
stroke
endps
// draw absolute box
defineps _barBox(float x, y; float x2, y2; float color)
newpath
1 setlinewidth
x y moveto
x y2 lineto
x2 y2 lineto
x2 y lineto
closepath
gsave
color setgray fill
grestore
0 setgray stroke
endps
// draw absolute box outline
defineps _barOutline(float x, y; float x2, y2; float dash, color)
newpath
1 setlinewidth
dash 0 gt { [ dash dash ] 0 setdash } if
x y moveto
x y2 lineto
x2 y2 lineto
x2 y lineto
closepath
color setgray stroke
endps
// draw absolute box path
defineps _barClipBox(float x, y; float w, h)
newpath
x y moveto
0 h rlineto
w 0 rlineto
0 h neg rlineto
closepath
clip
newpath
endps